{extend name="../../base/view/common/base" /}
{block name="style"}
{include file="/approve/add_style" /}
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">付款申请审批</h3>
	{eq name="$id" value="0"}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray">付款金额<font>*</font></td>
			<td><input type="text" name="amount" value="" autocomplete="off" placeholder="请输入付款金额" lay-verify="required|number" lay-reqText="请输入付款金额" class="layui-input"></td>
			<td class="layui-td-gray">付款方式<font>*</font></td>
			<td>
				<select name="detail_type" lay-verify="required" lay-reqText="请选择">
				  <option value="">--请选择--</option>
					<option value="1">银行卡</option>
					<option value="2">现金</option>
					<option value="3">汇票</option>
					<option value="4">电汇</option>
					<option value="5">贷记</option>
					<option value="6">支票</option>
					<option value="7">其他</option>
				</select>
			</td>
			<td class="layui-td-gray">付款日期<font>*</font></td>
			<td>
				<input id="detail_time" name="detail_time" autocomplete="off" readonly class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray-2">收款人全称<font>*</font></td>
			<td><input type="text" name="name" value="" autocomplete="off" placeholder="请输入收款人全称" lay-verify="required" lay-reqText="请输入收款人全称" class="layui-input"></td>
			<td class="layui-td-gray">银行账号</td>
			<td><input type="text" name="bank" value="" autocomplete="off" placeholder="请输入银行账号" class="layui-input"></td>
			<td class="layui-td-gray">开户行</td>
			<td>
				<input name="address" autocomplete="off" class="layui-input" value="" placeholder="请输入开户行">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">付款事由<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入申请事由" class="layui-textarea" lay-verify="required" lay-reqText="请输入申请事由"></textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">备注</td>
			<td colspan="5">
				<textarea name="remark" placeholder="请输入备注" class="layui-textarea"></textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5">
				<div class="layui-row" id="fileList">
					<input type="hidden" name="file_ids" value="">
				</div>
			</td>
		</tr>
	</table>
	{else/}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray">付款金额<font>*</font></td>
			<td><input type="text" name="amount" value="{$detail.amount}" autocomplete="off" placeholder="请输入费用金额" lay-verify="required|number" lay-reqText="请输入费用金额" class="layui-input"></td>
			<td class="layui-td-gray">付款方式<font>*</font></td>
			<td>
				<select name="detail_type" lay-verify="required" lay-reqText="请选择">
				  <option value="">--请选择--</option>
					<option value="1" {eq name="$detail.detail_type" value="1"}selected=""{/eq}>银行卡</option>
					<option value="2" {eq name="$detail.detail_type" value="2"}selected=""{/eq}>现金</option>
					<option value="3" {eq name="$detail.detail_type" value="3"}selected=""{/eq}>汇票</option>
					<option value="4" {eq name="$detail.detail_type" value="4"}selected=""{/eq}>电汇</option>
					<option value="5" {eq name="$detail.detail_type" value="5"}selected=""{/eq}>贷记</option>
					<option value="6" {eq name="$detail.detail_type" value="6"}selected=""{/eq}>支票</option>
					<option value="7" {eq name="$detail.detail_type" value="7"}selected=""{/eq}>其他</option>
				</select>
			</td>
			<td class="layui-td-gray">付款日期<font>*</font></td>
			<td>
				<input id="detail_time" name="detail_time" autocomplete="off" class="layui-input" value="{$detail.detail_time}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray-2">收款人全称<font>*</font></td>
			<td><input type="text" name="name" value="{$detail.name}" autocomplete="off" placeholder="请输入收款人全称" lay-verify="required" lay-reqText="请输入收款人全称" class="layui-input"></td>
			<td class="layui-td-gray">银行账号</td>
			<td><input type="text" name="bank" value="{$detail.bank}" autocomplete="off" placeholder="请输入银行账号" class="layui-input"></td>
			<td class="layui-td-gray">开户行</td>
			<td>
				<input name="address" autocomplete="off" class="layui-input" value="{$detail.address}" placeholder="请输入开户行">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">付款事由<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入付款事由" class="layui-textarea" lay-verify="required" lay-reqText="请输入付款事由">{$detail.content}</textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">备注</td>
			<td colspan="5">
				<textarea name="remark" placeholder="请输入备注" class="layui-textarea">{$detail.remark}</textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5" style="line-height:inherit">
				<div class="layui-row" id="fileList">
					<input type="hidden" name="file_ids" value="{$detail.file_ids}">
					{notempty name="$detail.file_ids"}
					{volist name="$detail.fileArray" id="vo"}
					<div class="layui-col-md4" id="uploadImg{$vo.id}">
						<div class="file-card">
							<i class="file-icon iconfont icon-renwuguanli"></i>
							<div class="file-title">{$vo.name}</div>
							<div class="file-tool">
								<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
								<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
							</div>
						</div>
					</div>
					{/volist}
					{/notempty}
				</div>
			</td>
		</tr>
	</table>
	{/eq}
	{include file="/approve/add_flow" /}
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
	function gouguInit() {
		var form = layui.form,
			tool=layui.tool,
			employeepicker = layui.employeepicker,
			laydate = layui.laydate;	
			
		if (typeof (flowStep) == "function") {
			flowStep();
		}
		//日期时间范围
		laydate.render({
			elem: '#detail_time',
			type: 'date',
			format: 'yyyy-MM-dd',
			showBottom: false
		});		
	}
</script>
{/block}
<!-- /脚本 -->